<template>
  <div>
    <a-modal
      ok-text="确认"
      cancel-text="取消"
      :maskClosable="false"
      :title="title"
      :width="576"
      @cancel="handleClose"
      :destroyOnClose="true"
      @ok="handleOk"
      :visible="visible"
      footer=""
    >
      <template>
        <div class="modalBut">
          <a-button @click="handleClose">
            取消
          </a-button>
          <a-button @click="handleOk" type="primary">确认</a-button>
        </div>
      </template>
      <a-form-model-item label="计划单号">
        <a-input placeholder="请输入计划单号" v-model.trim="planNum" />
      </a-form-model-item>
    </a-modal>
  </div>
</template>
<script>
export default {
  data() {
    return {
      visible: false,
      title: "",
      planNum: "",
    };
  },
  methods: {
    modalAdd() {
      this.visible = true;
    },
    handleClose() {
      this.visible = false;
    },
    handleOk() {
      console.log(this.planNum);
      if (String(this.planNum).length < 1) {
        this.$message.error("请输入计划单号");
      } else {
        this.visible = false;
        this.$emit("ok", this.planNum);
        this.planNum = "";
      }
    },
  },
};
</script>
<style lang="less" scoped>
/deep/ .ant-row{
  margin-top: 30px;
}
</style>
